﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;

namespace DARE
{
    public class CCheckboxData : CButtonData
    {
        public CStaticImageData checkImage;
        public bool isChecked;

        public override void FillDataStructure(CWidget wid)
        {
            CCheckbox w = wid as CCheckbox;
            base.FillDataStructure(wid);
            checkImage = new CStaticImageData();
            checkImage.FillDataStructure(w.CheckImage);
            isChecked = w.IsChecked;
        }

        public override void FillFromDataStructure(ref CWidget wid, CHUDSystem hud)
        {
            base.FillFromDataStructure(ref wid, hud);
            CHudTexture tex = (wid as CCheckbox).CheckImage.Texture;
            checkImage.texture.FillFromDataStructure(tex);
            (wid as CCheckbox).CheckImage.Texture = tex;
            (wid as CCheckbox).IsChecked = isChecked;
        }
    }
}
